<?php
/**
 * @author zhangrui
 */

namespace App\Common\RabbitMQ;


class ConnectFactory
{
    protected static $conn;

    private function __construct()
    {}

    private function __clone()
    {}

    /**
     * @param array $conf
     * @return \AMQPConnection
     */
    public static function getConnect(array $conf)
    {
        if (is_null(self::$conn)) {
            self::$conn = new \AMQPConnection($conf);
        }
        return self::$conn;
    }
}
